package study.config;

import dev.langchain4j.model.chat.ChatModel;
import dev.langchain4j.model.openai.OpenAiChatModel;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author codechenxi
 * @description  多模型共存配置
 * @since 2025/7/2 21:07
 */

@Configuration
public class LLMConfig {


    /**
     * @description 知识出处，https://docs.langchain4j.dev/get-started
     * @return
     */
    @Bean(name = "qwen")
    public ChatModel chatModelQwen(){

        return OpenAiChatModel.builder()
                .apiKey(System.getenv("DASHSCOPE_API_KEY"))
                .modelName("qwen-plus")
                .baseUrl("https://dashscope.aliyuncs.com/compatible-mode/v1")
                .build();
    }


    /**
     * @description 知识出处，https://api-docs.deepseek.com/zh-cn/
     * @return
     */
    @Bean(name = "deepseek")
    public ChatModel chatModelDeepSeek(){

        return OpenAiChatModel.builder()
                .apiKey(System.getenv("DEEPSEEK_API_KEY"))
                .modelName("deepseek-chat")
//                .modelName("deepseek-reasoner")
                .baseUrl("https://api.deepseek.com/v1")
                .build();
    }
}
